﻿@model DataModel.Models.ScheduleModel

@{
    ViewBag.Title = "Group Schedule";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Schedule</h2>

<div class="filter">
    <form method="POST">
        <span>from</span>
        <input type="text" class="tbx datepicker" name="fromDateString" value="@DateTime.Today.ToShortDateString()"/>
        <span>to</span>
        <input type="text" class="tbx datepicker" name="toDateString" value="@DateTime.Today.ToShortDateString()"/>
        <input type="submit" class="btn" value="Refresh"/>
    </form>
</div>



@foreach(var day in Model.dayModels) {
<div class="schedule-caption">
	<span class="date">@day.date.ToShortDateString()</span>
	<span class="weekday">@day.date.DayOfWeek</span>
</div>
    
    <div class="schedule-day">
	    <div class="lesson label">
		    <div class="row time">when</div>
		    <div class="row subject">what</div>
		    <div class="row lesson-type">type</div>
		    <div class="row classroom">where</div>
		    <div class="row professor">who</div>
	    </div>
        @foreach (var lesson in day.lessonModels)
	    {
	        <div class="lesson">
		        <div class="time">@lesson.BeginTime.ToString("HH:mm") - @lesson.EndTime.ToString("HH:mm")</div>
		        <div class="subject">@lesson.Subject.shortName</div>
		        <div class="lesson-type">@lesson.LessonType.name</div>
		        <div class="classroom">@lesson.Auditory.FullName</div>
		        <div class="professor">@lesson.Professor.User.ShortName</div>
	        </div>
	    }
</div>
 
}